<?php

namespace app\user\controller;
/**
 *
 CREATE TABLE `tp_researchlearn` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`title` VARCHAR(255) NOT NULL COMMENT '标题' COLLATE 'utf8_general_ci',
`url` VARCHAR(255) NOT NULL COMMENT '链接地址',
`uid` INT(5) NOT NULL COMMENT '用户id',
`lang` VARCHAR(50) NOT NULL DEFAULT 'zh-cn' COMMENT '语言' COLLATE 'utf8_general_ci',
`update_time` INT(11) NULL DEFAULT NULL COMMENT '更新时间',
`create_time` INT(11) NULL DEFAULT NULL COMMENT '创建时间',
`tid` INT(5) NULL DEFAULT NULL,
PRIMARY KEY (`id`)
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB
AUTO_INCREMENT=1
;

 */
/**
 * 学习记录
 * Class Researchlearn
 * @package app\user\controller
 */
class Researchlearn extends base
{
    public function _initialize()
    {
        $this->model = model('researchlearn');
    }
//前置方法
    protected $beforeActionList = [
        'map' => ['only' => 'index'],
    ];
    /**
     * 搜索
     */
    protected function map()
    {
        if ($this->request->isGet()) {
            $data = $this->request->param();
            $this->datas = array();

            if (!empty($data['title'])) {
                $this->datas ['title'] = ['like', '%' . $data['title'] . '%'];
            }
        }
        $this->datas ['uid'] = $this->getLoginUser()->id;
    }


}
